#!/usr/bin/env python
import sys
sys.path.append("../python")
import edbcli
import random
import time

if __name__ == "__main__":

	edb = edbcli.Client(["127.0.0.1:11911"])
	
	c = 10
	
	for x in range(c):
		results = edb.query("INSERT INTO test_domain VALUES( x:$x );", [{"x":x}])

	for i in range(c):
		ql = []
		for j in range(100):
			x = i * j
			y = "".join( [random.choice('abcdefghij') for q in range(20)] )
			z = x*x
			ql.append( { "domain":	"domain_"+random.choice('123456789'), "x": x, "y":y, "z":z, "time": time.ctime() } )
		
		r = edb.query( "INSERT INTO $domain VALUES( _name:$x, y:$y, z:$z, time:$time);", ql)	
		
	for x in range(c):
		if x == 4:
			continue		
		results = edb.query("DELETE * FROM test_domain WHERE x = $x;", [{"x":x}])
	
	